<form id="auto-data-form" action="docType/saveOrUpdate" class="form-horizontal bv-form" method="post" role="form">
	<div style="display: none;">
		<input id="model.id" name="model.id" value="#(model.id)" placeholder="类型主键" type="hidden" />
		<input id="model.sort" name="model.sort" value="#(model.sort)" placeholder="排序号" type="hidden" />
		<input id="model.parentId" name="model.parentId" value="#(model.parentId)" placeholder="上级类型" type="hidden" />
	</div>

	<div class="form-group">
		<label for="model.parentId" class="col-sm-2 control-label">上级类型</label>
		<div class="col-sm-10">
			<input value="#(parent.name??)" class="form-control input-md" readonly="readonly"/>
		</div>
	</div>
	
	<div class="form-group">
		<label for="model.name" class="col-sm-2 control-label">类型名称</label>
		<div class="col-sm-10">
			<input id="model.name" name="model.name" value="#(model.name)" placeholder="类型名称" class="form-control input-md" required maxlength="64"/>
		</div>
	</div>
	
	<div class="form-group">
		<label for="model.state" class="col-sm-2 control-label">类型状态</label>
		<div class="col-sm-10">
			#@dict_select("model.state",model.state,"DATA_STATE",false,"类型状态","required")
		</div>
	</div>
	
	<div class="form-group">
		<label for="model.remark" class="col-sm-2 control-label">类型描述</label>
		<div class="col-sm-10">
			<textarea id="model.remark" name="model.remark" placeholder="类型描述" class="form-control input-md" maxlength="1024">#(model.remark)</textarea>
		</div>
	</div>

	<div id="ztree_form_tools" class="form-group text-center" style="display: none;">
		<button type="button" class="btn btn-success auto-btn auto-submit-ajax"  data-callback="_callback"><i class="fa fa-check-square"></i>&nbsp;&nbsp;保存</a></button>
	</div>	
</form>
<script type="text/javascript">
function _callback(data){
	if(data.success) {
		jid("model.id").val(data.data);
		_updateZtreeNode(data.data,jid("model.name").val());
	}
}
$(document).ready(function() {
	if(ztree_mgr_pv){
		$("#ztree_form_tools").show();
	}
});
</script>